package simulation;

/**
 * @author cwhalen
 *
 */
public class EarthSim
{
	private Sun sModel;
	private Earth eModel;
	private int timeStep;
	private int itteration;


	/**
	 * @return
	 */
	public Earth getEModel()
	{
		return eModel;
	}


	/**
	 * @return
	 */
	public int getTimeStep()
	{
		return timeStep;
	}


	/**
	 * @param gridSpacing
	 * @param radius
	 * @param timeStep
	 */
	public EarthSim(int gridSpacing, int radius, int timeStep)
	{
		super();
		this.eModel = new Earth(gridSpacing, radius);
		this.sModel = new Sun(0, 0);
		this.timeStep = timeStep;
	}


	/**
	 * 
	 */
	private void run()
	{
		int maxItt = 1000;

		for (itteration = 0; itteration < maxItt; itteration++)
		{
			System.out.print(eModel.totalTemp() + "\n");
			eModel.step(this.sModel);
			eModel.print();
			System.out.println("\n");

			if (itteration % 2 == 0)
			{
				sModel.moveSun(15);
			}
		}

	}


	/**
	 * @param args
	 */
	public static void main(String[] args)
	{
		EarthSim driver = new EarthSim(5, 200, 60);
		driver.run();
	}

}
